package game.players.states;

import game.players.SoccerPlayer;
import game.soccerField.Arc;

import com.uqbar.vainilla.DeltaState;

public abstract class PlayerState {
	
	private SoccerPlayer player;
	
	public PlayerState(SoccerPlayer player) {
		this.setPlayer(player);
	}
	
	public abstract void update(DeltaState deltaState);
	
	public abstract boolean isWithBall();
	
	public abstract boolean isRight();
	
	protected boolean isAtDistanceFromTheArc(Arc arc, int i, int j) {
		return arc.getX() + arc.getAppearance().getWidth() - this.getPlayer().getScene().getSoccerBall().getX() <= i && arc.getX() + arc.getAppearance().getWidth() - this.getPlayer().getScene().getSoccerBall().getX() >= -i
				&& arc.getY() - this.getPlayer().getScene().getSoccerBall().getY() <= j && arc.getY() - this.getPlayer().getScene().getSoccerBall().getY() >= -j * 2;
	}
	
	
	
	

	public SoccerPlayer getPlayer() {
		return player;
	}

	public void setPlayer(SoccerPlayer player) {
		this.player = player;
	}

}
